package com.edu.Sevice;
import java.util.List;

import com.edu.model.PageList;
import com.edu.model.Shoes;
import com.edu.DAO.PageListDAO;

public class ListService {
	
	//不分类获取商品列表
	public PageList getlistall(int listnum,int pageno) {
		PageListDAO pd =new PageListDAO();
		PageList pl=new PageList();
		int shoesnum=pd.getshoesnum();
		int pagenum=0;
		List<Shoes> sh=null;
		if(shoesnum%listnum==0)
		{
			pagenum=shoesnum/listnum;
		}else {
			pagenum=shoesnum/listnum+1;
		}
		sh=pd.qruerylistall((pageno-1)*listnum, listnum);
		pl.setShoesnum(shoesnum);
		pl.setListnum(listnum);
		pl.setItem(sh);
		pl.setPagenum(pagenum);
		pl.setPageno(pageno);
		return pl;
	}
	
}
